# -*- coding: utf-8 -*-
"""
author:LTH
data:
"""
import torch
from torch import nn

import cv2


img_gray=cv2.imread("save.jpg",0)
img=cv2.imread("save.jpg")

r=img[:,:,2]
g=img[:,:,1]
b=img[:,:,0]

import numpy as np

sample=np.random.uniform(-1,1,[3])


# img=0.2*(r*sample[0]+g*sample[1]+b*sample[0])+0.8*img_gray
img=0.2*(np.sum(img*sample,-1))+0.8*img_gray
img=np.array(img,dtype=np.uint8)
cv2.imshow("dsa",img)
cv2.waitKey(0)
from torchvision.utils import make_grid